package com.qkl.xiatang.app.entity.sale;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;

@Data
@TableName(value = "sale_batch_detail")
public class SaleBatchDetailEntity {

    @TableId(type= IdType.ASSIGN_ID)
    private String id;

    private String batchId;

    private Double weigh;

    private Double price;

    private Double totalPrice;

    private String userId;

    private String userName;

    private Date createTime;

    @TableField(exist = false)
    private String createDate;

    public String getCreateDate(){
        if(null != createTime){
            return new SimpleDateFormat("yyyy.MM.dd HH:mm:ss").format(createTime);
        }
        return "";
    }


}

